{extend name="public/base"}

{block name="title"}用户列表{/block}

{block name="main"}
<!--数据列表-->
<table class="layui-table">
    <thead class="bg-light">
    <tr>
        <th class="text-center">ID</th>
        <th class="text-center">用户名</th>
        <th class="text-center">创建时间</th>
        <th class="text-center">操作</th>
    </tr>
    </thead>
    <tbody>
    {assign name="empty" value='<tr><td colspan="7" class="text-center text-muted">没有数据</td></tr>'}
    {volist name="list" id="obj" empty="$empty"}
    <tr>
        <td class="text-center">{$obj.id}</td>
        <td class="text-center">{$obj.username}</td>
        <td class="text-center">{$obj.create_at}</td>
        <td class="text-center">
            <form action="{:url('/admin/'.$obj.id)}" method="post">
                <input type="hidden" name="_method" value="delete">
                <a href="{:url('/admin/'.$obj.id.'/edit')}" class="layui-btn layui-btn-warning layui-btn-sm">修改</a>
            </form>
        </td>
    </tr>
    {/volist}
    </tbody>
</table>

<!--分页-->
{/block}

{block name="js"}
<script type="text/javascript">
    $('.btn-delete').click(() => {
        let flag = confirm('您真的要删除这条数据吗？');
        return flag ? true : false;
    });
    $('[data-toggle="tooltip"]').tooltip();
</script>
{/block}
